import { Module, ValidationPipe } from '@nestjs/common';
import { RoleController } from './role.controller';
import { RoleService } from './role.service';
import { RoleEntity } from './role.entity';
import { TypeOrmModule } from '@nestjs/typeorm';
import { APP_PIPE } from '@nestjs/core';

@Module({
  imports: [TypeOrmModule.forFeature([RoleEntity])],
  controllers: [RoleController],
  providers: [
    RoleService,
    // 在模块中使用pip
    {
      provide: APP_PIPE,
      useClass: ValidationPipe,
    },
  ],
})
export class RoleModule {}
